package com.shiguiwu.springboot3.service;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.spring.AiService;
import dev.langchain4j.service.spring.AiServiceWiringMode;
import reactor.core.publisher.Flux;

/**
 * @description: 聊天服务
 * @author: stone
 * @date: Created by 2025/10/19 11:24
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springboot3.service
 */
@AiService(
        wiringMode = AiServiceWiringMode.EXPLICIT,
        chatModel = "openAiChatModel",
        streamingChatModel = "openAiStreamingChatModel",
        //chatMemory = "chatMemory"
        //chatMemoryProvider = "chatMemoryProvider"
        chatMemoryProvider = "chatRedisMemoryProvider" //会话记录和隔离
        //contentRetriever = "contentRetriever",//配置向量数据库检索对象
        //tools = "reservationTool"
)
public interface ChatService {


    String chat(String message);

    String chat(@MemoryId Object memoryId, @UserMessage String message);
    /**
     * 流式
     *
     * @param message
     * @return
     * @SystemMessage 系统消息注解
     */

    //@SystemMessage("您好！我是客服小江，很高兴为你服务")
    //@UserMessage("每次回答完，都加上一句：“我的回答满意不!” ，{{it}}")
    Flux<String> chatStream(String message);

    /**
     * 聊天记忆
     *
     * @param memoryId
     * @param message
     * @return
     */
    //public Flux<String> chatMemory(@MemoryId Object memoryId, @UserMessage String message);

    /**
     * 聊天记录存redis
     * @param memoryId
     * @param message
     * @return
     */
    //Flux<String> chatRedisMemory(@MemoryId Integer memoryId, @UserMessage String message);
    //
    //@SystemMessage(fromResource = "system.txt")
    //Flux<String> chatEmbedding(@MemoryId Integer memoryId, @UserMessage String message);

}
